package com.ylr.base.common.constant;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wei
 * date: 2021-03-15 16:15:00
 * className: Constant 静态常量类
 * version: 1.0
 * description:
 */
public class Constant {

    /**
     *  升序排序（全称）
     */
    public static final String ASCENDING = "ascending";
    /**
     *  降序排序（全称）
     */
    public static final String DESCENDING = "descending";

    /**
     * 用户令牌key
     */
    public static final String AUTHORIZATION = "authorization";

    /**
     * 用户认证结果
     */
    public static final String AUTH_RESULT = "authResult";
    /**
     * 校验通过值
     */
    public static final String AUTH_PASS = "0";

    /**
     * 请求指纹
     */
    public static final String FINGERPRINT = "fingerprint";

    /**
     * 请求来源服务简称
     */
    public static final String SOURCE = "source";

    /**
     * 模块
     */
    public static final String MODULE = "module";

    /**
     * 渠道
     */
    public static final String CHANNEL = "channel";

    /**
     * 请求设备
     */
    public static final String DEVICE = "device";

    /**
     * 请求设备操作系统
     */
    public static final String OS = "os";

    /**
     * 数值0
     */
    public static final Integer ZERO = 0;

    /**
     * 数值1
     */
    public static final Integer ONE = 1;

    /**
     * 数值-1
     */
    public static final Integer NEGATIVE_ONE = -1;

    /**
     * 用户请求最大连续操作次数
     */
//    public static final Integer MAX_LAST_COUNT = 20;
    public static final Integer MAX_LAST_COUNT = 15000;

    /**
     * 用户一分钟最大请求次数
     */
//    public static final Integer MAX_COUNT_OPT = 100;
    public static final Integer MAX_COUNT_OPT = 100000;

    /**
     * 博客成为热门博客的日浏览次数
     */
    public static final Integer DAY_HOT_VIEW = 10;

    /**
     * 博客成为热门博客的月浏览次数
     */
    public static final Integer MONTH_HOT_VIEW = 100;

    /**
     * 一分钟对应的毫秒数值
     */
    public static final Integer MINUTE_NUM = 60_000;

    /**
     * 五分分钟对应的毫秒数值
     */
    public static final Integer FIVE_MINUTE_NUM = 300_000;

    /**
     * 一天对应的毫秒数值
     */
    public static final Integer ONE_DAY_NUM = 86_400_000;

    /**
     * http请求类对象携带的一个属性，存储正在请求的用户主键
     */
    public static final String USER_ID = "userId";

    /**
     * http请求类对象携带的一个属性，存储正在请求的用户所用的ip地址
     */
    public static final String REQUEST_IP = "requestIp";

    /**
     * 图片验证码占位符
     */
    public static final String IMAGE = "image";

    /**
     * 接口限流配置-默认配置键
     */
    public static final String RATE_LIMIT_DEFAULT = "default";

    /**
     * 系统使用的分隔符
     */
    public static final String SPLIT = "-";

    /**
     * 超级管理员权限标识
     */
    public static final String SYSTEM_ADMIN = "system:admin";

    /**
     * 超级管理员角色键
     * 使用’-‘做单词分割是为了与添加角色时输入的角色键冲突
     */
    public static final String SYSTEM_ROLE = "system-role";

    /**
     * 日志链路追踪key
     */
    public static final String TRACE_ID = "traceId";

    /**
     * 延迟线程名称前缀
     */
    public static final String DELAY_THREAD_NAME_PREFIX = "delay-thread-";

}
